package com.epsoft.odin7cj.flow.example;

import java.util.List;
import java.util.UUID;

import org.activiti.engine.IdentityService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.identity.Group;

/**
 * 用户组操作
 * @author Administrator
 *
 */
public class C02Group {

	public static void main1(String[] args) {
		
		// 流程引擎
		ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
		
		// 获取身份服务
		IdentityService ids= engine.getIdentityService();
		
		
		for(int i=0;i<100;i++) {
			Group group = ids.newGroup(UUID.randomUUID().toString());
			group.setName("GROUP"+i);
			group.setType("1");
			//ids.saveGroup(group);
		}
		
		List<Group> listGroup = ids.createGroupQuery().groupNameLike("%FIRST%").listPage(1, 5);
		for(Group group : listGroup) {
			System.out.println("\n group:"+group.getName());
		}
		
	}

}
